package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	grpcinsecure "google.golang.org/grpc/credentials/insecure"
	user_pb "mxshop/api/user/v1"
	"time"
)

func main() {
	conn, err := grpc.Dial(
		"192.168.101.54:32382",
		grpc.WithTransportCredentials(grpcinsecure.NewCredentials()),
	)
	if err != nil {
		panic(err)
	}
	uc := user_pb.NewUserClient(conn)
	for {
		user, err := uc.GetUserList(context.Background(), &user_pb.PageInfo{})
		if err != nil {
			fmt.Println(err)
			panic(err)
		}
		//fmt.Println(r)
		fmt.Println(user)
		time.Sleep(time.Millisecond * 2)
	}
}
